package com.sky.controller.user;

import com.sky.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

@RestController("userShopController") // 手动指定Bena 名称
@Slf4j
@RequestMapping("/user/shop")
public class ShopController {
  @Autowired
  private RedisTemplate redisTemplate;
  
  /**
   * h获取店铺营业状态
   * @return
   */
  @GetMapping("/status")
  public Result<Integer> getStatus() {
    Integer status = (Integer) redisTemplate.opsForValue().get("shop:status");
    return Result.success(status);
  }
}
